"""
核心模块
提供应用的基础配置、日志、安全等功能
"""

from .config import Settings, settings, get_settings
from .logging import (
    setup_logging,
    get_logger,
    request_logger,
    error_logger,
    audit_logger,
    LogContext,
    log_with_context
)
from .exceptions import (
    BaseException,
    ValidationError,
    NotFoundError,
    AuthenticationError,
    AuthorizationError,
    BusinessLogicError,
    ExternalServiceError,
    DatabaseError,
    FileOperationError,
    TTSSError,
    VideoProcessingError,
    AudioProcessingError,
    RateLimitError,
    ConfigurationError,
    setup_exception_handlers,
    error_reporter,
    ErrorContext,
    with_error_handling
)
from .security import (
    PasswordManager,
    TokenManager,
    RateLimiter,
    APIKeyManager,
    InputValidator,
    SecurityHeaders,
    password_manager,
    token_manager,
    rate_limiter,
    api_key_manager,
    input_validator,
    get_current_user,
    get_current_user_optional,
    require_permission,
    require_role,
    rate_limit,
    get_api_key,
    generate_csrf_token,
    verify_csrf_token,
    security_audit_logger
)
from .versioning import (
    APIVersion,
    APIVersionManager,
    version_manager,
    versioned_api,
    get_version_info,
    create_version_router,
    APIVersionMiddleware,
    validate_api_version
)

__all__ = [
    # 配置
    'Settings',
    'settings',
    'get_settings',
    
    # 日志
    'setup_logging',
    'get_logger',
    'request_logger',
    'error_logger',
    'audit_logger',
    'LogContext',
    'log_with_context',
    
    # 异常处理
    'BaseException',
    'ValidationError',
    'NotFoundError',
    'AuthenticationError',
    'AuthorizationError',
    'BusinessLogicError',
    'ExternalServiceError',
    'DatabaseError',
    'FileOperationError',
    'TTSSError',
    'VideoProcessingError',
    'AudioProcessingError',
    'RateLimitError',
    'ConfigurationError',
    'setup_exception_handlers',
    'error_reporter',
    'ErrorContext',
    'with_error_handling',
    
    # 安全
    'PasswordManager',
    'TokenManager',
    'RateLimiter',
    'APIKeyManager',
    'InputValidator',
    'SecurityHeaders',
    'password_manager',
    'token_manager',
    'rate_limiter',
    'api_key_manager',
    'input_validator',
    'get_current_user',
    'get_current_user_optional',
    'require_permission',
    'require_role',
    'rate_limit',
    'get_api_key',
    'generate_csrf_token',
    'verify_csrf_token',
    'security_audit_logger',
    
    # 版本管理
    'APIVersion',
    'APIVersionManager',
    'version_manager',
    'versioned_api',
    'get_version_info',
    'create_version_router',
    'APIVersionMiddleware',
    'validate_api_version'
]
